package mcchristian;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class Albums_Action extends ActionSupport {

	private List<Albums_Folder> albums_folders = new ArrayList<Albums_Folder>();
	private String message;
	
	public String execute() throws Exception  
    {   
		Map session = ActionContext.getContext().getSession();
		Pic_Function pic_function = new Pic_Function();
		String pic_folder_path = (String)session.get("rootpath") + "albums";
		if ((String)session.get("rootpath") == null){
			return "INDEX";  
		}	
		albums_folders = pic_function.getAlbums_Folder(pic_folder_path);
        return SUCCESS;  
    }

	public List<Albums_Folder> getAlbums_folders() {
		return albums_folders;
	}
	
	public void setAlbums_folders(List<Albums_Folder> albums_folders) {
		this.albums_folders = albums_folders;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	
}
